package com.diy.common.dao;

import com.diy.common.baseModel.Paging;

import java.util.List;
import java.util.Map;

/**
 * Created by GY on 2015/11/22.
 */
public interface Dao {

    <T> T selectOne(String statement);

    <T> T selectOne(String statement, Object parameter);

    <E> List<E> selectList(String statement);

    <E> List<E> selectList(String statement, Object parameter);

    <E> List<E> selectList(String statement, int pageNumber, int pageSize);

    <E> List<E> selectList(String statement, Object parameter, int pageNumber, int pageSize);

    <K, V> Map<K, V> selectMap(String statement, String mapKey);

    <K, V> Map<K, V> selectMap(String statement, Object parameter, String mapKey);

    <K, V> Map<K, V> selectMap(String statement, Object parameter, String mapKey, int pageNumber, int pageSize);

    <T> Paging<T> selectPaging(String statement, int pageNumber, int pageSize);

    <T> Paging<T> selectPaging(String statement, Object parameter, int pageNumber, int pageSize);

    // ----------------------------------------------------------------------------------------------------

    int insert(String statement);

    int insert(String statement, Object parameter);

    // ----------------------------------------------------------------------------------------------------

    int update(String statement);

    int update(String statement, Object parameter);

    // ----------------------------------------------------------------------------------------------------

    int delete(String statement);

    int delete(String statement, Object parameter);
}
